options nocenter;
libname replicat 'c:\measure\replicat\sas';
filename citizen 'c:\measure\replicat\citi6093.prn';
filename install 'c:\measure\replicat\instid60.prn';
filename taggart 'c:\measure\replicat\sas\taggart.dat';
filename morgan 'c:\measure\replicat\sas\morgan.dat';
filename hilleigh 'c:\measure\replicat\sas\hilleigh.dat';
data citizen;
        infile citizen;
        input state year citiada citicope citizen;
        keep state year citizen;
proc sort; by state year;
data install;
        infile install lrecl=225;
        input stateid $ state year govparty pctdemh pctreph pctdems pctreps adac copec allc adadd
                copedd alldd adarr coperr allrr copeg adag allg instada instcope install;
        keep state year install;
proc sort; by state year;
data replicat.ideology;
        merge citizen install; by state year;
data taggart;
        infile taggart lrecl=220;
        input state vcrime pcrime income poverty male nwmale nwmaley pop popden chpopden chpop
                mcgovern ideology pculture determ mandsent parole credits probnum facilcap ratio
                occupied org capacity incarcer;
proc sort; by state;
data ideot;
        set replicat.ideology;
        if year>80 then delete;
        if year<80 then delete;
        cit80 = citizen;
        inst80 = install;
proc sort; by state;
data ideot2;
        set replicat.ideology;
        if year>83 then delete;
        if year<83 then delete;
        cit83 = citizen;
        inst83 = install;
proc sort; by state;
data replicat.taggart;
        merge taggart ideot ideot2; by state;
cit802 = (1 - ((9 - 1) / (76.98-15.34) * 15.34)) +
        (((9 - 1) / (76.98-15.34)) * cit80);
inst802 = (1 - ((9 - 1) / (79.83-7.71) * 7.71)) +
        (((9 - 1) / (79.83-7.71)) * inst80);
cit832 = (1 - ((9 - 1) / (74.17 - 19.55) * 19.55)) +
        (((9 - 1) / (74.17 - 19.55)) * cit83);
inst832 = (1 - ((9 - 1) / (92.86 - 10.17) * 10.17)) +
        (((9 - 1) / (92.86 - 10.17)) * inst83);
proc reg;
        model incarcer = vcrime poverty nwmaley chpopden pculture mandsent facilcap probnum capacity/stb;
proc reg;
        model incarcer = vcrime poverty nwmaley chpopden cit802 mandsent facilcap probnum capacity/stb;
        model incarcer = vcrime poverty nwmaley chpopden cit832 mandsent facilcap probnum capacity/stb;
data morgan;
        infile morgan lrecl=120;
        input state taxequit taxcap taxeff fedaid interest turnout party conserv paper incomet
                salest progress pctrevin;
proc sort; by state;
data ideom2;
        set replicat.ideology;
        if year>90 then delete;
        if year<90 then delete;
proc sort; by state;
data replicat.morgan;
        merge morgan ideom2; by state;
citizen2 = (-63 - ((78.9 - (-63)) / (88.3 - 21.92) * 21.92)) +
        (((78.9 - (-63)) / (88.3 - 21.92)) * citizen);
install2 = (-63 - ((78.9 - (-63)) / (90.63 - 12.75) * 12.75)) +
        (((78.9 - (-63)) / (90.63 - 12.75)) * install);
proc reg;
        model taxequit = interest conserv paper salest pctrevin/stb;
        model taxequit = interest citizen2 paper salest pctrevin/stb;
data hill;
        infile hilleigh lrecl=120;
        input welpercp welpcpi afdcneed afdc2pci state clasbias lower upper pculture state2
                ideology pcpi urban govrace;
proc sort; by state;
data ideoh2;
        set replicat.ideology;
        if year>85 then delete;
        if year<85 then delete;
proc sort; by state;
data replicat.hilleigh;
        merge hill ideoh2; by state;
        if state = 17 or state = 18 or state = 24 or state = 30 or state = 46 then delete;
citizen2 = (-122 - ((194 - (-122)) / (90.1 - 16.4) * 16.4)) +
        (((194 - (-122)) / (90.1 - 16.4)) * citizen);
install2 = (-122 - ((194 -(-122)) / (91.45 - 8.2) * 16.4)) +
        (((194 -(-122)) / (91.45 - 8.2)) * install);
proc reg;
model welpercp = pculture clasbias pcpi urban/stb;
model welpercp = citizen2 clasbias pcpi urban/stb;
model welpcpi = citizen2 clasbias pcpi urban/stb;
model welpcpi = pculture clasbias pcpi urban/stb;
proc reg;
model welpercp = citizen2 clasbias pcpi urban/stb;
model welpcpi = citizen2 clasbias pcpi urban/stb;
proc reg;
model afdcneed = pculture clasbias pcpi urban/stb;
model afdcneed = citizen2 clasbias pcpi urban/stb;
model afdc2pci = citizen2 clasbias pcpi urban/stb;
model afdc2pci = pculture clasbias pcpi urban/stb;
proc reg;
model afdcneed = citizen2 clasbias pcpi urban/stb;
model afdc2pci = citizen2 clasbias pcpi urban/stb;
run;
